package com.xxl.controller;

import com.xxl.dto.vo.BlogVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.hibernate.validator.constraints.Length;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * blog相关的接口
 * @author xxl
 * @date 2023/4/4
 */
@Validated
@Tag(name = "BlogApi",description = "博客相关接口")
public interface BlogApi<T> {
    /**
     * 写博客
     * @param  blogVo
     * @return  T
     */
    @Operation(summary = "发布博客接口")
    @ApiResponse(responseCode = "200",description = "发布成功")
    @ApiResponse(responseCode = "500",description = "发布失败")
    @Parameter(name = "blogVo",description = "视图对象实体类")
    T writeBlog(@Validated BlogVo blogVo);

    /**
     * 删除博客
     * @param uuid
     * @return  T
     */
    @Operation(summary = "删除博客接口")
    @ApiResponse(responseCode = "200",description = "删除成功")
    @ApiResponse(responseCode = "500",description = "删除失败")
    @Parameter(name = "uuid",description = "博客id")
    T deleteSelfBlog(String uuid);

    /**
     * 修改播客
     * @param blogVo
     * @return T
     */
    @Operation(summary = "修改博客接口")
    @ApiResponse(responseCode = "200",description = "修改成功")
    @ApiResponse(responseCode = "500",description = "修改失败")
    @Parameter(name = "blogVo",description = "视图对象实体类")
    T modify(@Validated BlogVo blogVo,String uuid);

    /**
     * 收藏博客
     * @param  uuid
     * @return T
     */
    @Operation(summary = "收藏博客接口")
    @ApiResponse(responseCode = "200",description = "收藏成功")
    @ApiResponse(responseCode = "500",description = "收藏失败")
    @Parameter(name = "uuid",description = "博客id")
    T collectBlogByUUID(String uuid);
    /**
     * 取消收藏博客
     * @param uuid
     * @return  T
     */
    @Operation(summary = "取消收藏博客接口")
    @ApiResponse(responseCode = "200",description = "取消收藏成功")
    @ApiResponse(responseCode = "500",description = "取消收藏失败")
    @Parameter(name = "uuid",description = "博客id")
    T canselCollectBlogByUUID(String uuid);

    /**
     * 查看自己写的所有博客
     * @param username
     * @return T
     */
    @Operation(summary = "查询此账户的主人发布的所有博客")
    @ApiResponse(responseCode = "200",description = "查询成功")
    @ApiResponse(responseCode = "500",description = "查询失败")
    @Parameter(name = "username",description = "账户名")
    T queryAllSelfBlog(String username);
    /**
     * 以后服务器额能查到的就不需要传递
     * 查询当前用户收藏的所有博客
     * @return  T
     */
    @Operation(summary = "查询当前用户收藏的博客")
    @ApiResponse(responseCode = "200",description = "查询成功")
    @ApiResponse(responseCode = "500",description = "查询失败")
    T queryAllCollectBlogs();

}
